package com.jman.message.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jman.message.domain.Message;
import com.jman.message.dao.MessageDao;
import com.jman.message.dto.MessageDTO;
import com.jman.message.service.IMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.xml.transform.Result;
import java.util.List;

@Slf4j
@Service
public class MessageServiceImpl extends ServiceImpl<MessageDao, Message> implements IMessageService {

    public String saveMessage(MessageDTO messageDTO) {
        Message message = BeanUtil.copyProperties(messageDTO, Message.class);
        if (save(message)) {
            return message.getContent();
        }
        return null;
    }
}
